﻿using BootstrapBlazor.Components;
using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AdminBlazor.Entities;

/// <summary>
/// 系统设置
/// </summary>
[Table(Name = "configentity")]
[Index("uk_code", "Code", true)]
public class ConfigEntity : EntityFull
{
    [Navigate(nameof(ParentId))]
    public ConfigEntity Parent { get; set; }
    [Navigate(nameof(ParentId))]
    public List<ConfigEntity> Childs { get; set; }

    /// <summary>
    /// 是否系统
    /// </summary>
    public bool IsSystem { get; set; }
    /// <summary>
    /// 父级
    /// </summary>
    public long ParentId { get; set; }

    /// <summary>
    /// 名称
    /// </summary>
    [Column(StringLength = 200)]
    public string Name { get; set; }

    /// <summary>
    /// 唯一码
    /// </summary>
    [Column(StringLength = 30)]
    public string Code { get; set; }

    /// <summary>
    /// 内容
    /// </summary>
    [Column(StringLength = 500)]
    public string Content { get; set; }

    /// <summary>
    /// 说明
    /// </summary>
    [Column(StringLength = 200)]
    public string Rmark { get; set; }
}